package com.android.networking.connection;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;
import com.android.controller.*;

public class ClientInfoPool {
	private String clientIpAddr;
	private int connectionId;
	private BufferedReader input;
	private PrintWriter output;
	private Socket sock;
	
	private PlayerGameInfo playerGameInfo;
	
	public PlayerGameInfo getPlayerGameInfo() {
		return playerGameInfo;
	}
	public void setPlayerGameInfo(PlayerGameInfo playerGameInfo) {
		this.playerGameInfo = playerGameInfo;
	}
	
	public Socket getSock() {
		return sock;
	}
	public void setSock(Socket sock) {
		try{
			this.sock = sock;
			input = new BufferedReader(new InputStreamReader(sock.getInputStream()));
			output = new PrintWriter(sock.getOutputStream(),true);
		}catch(IOException io){
			System.out.println("Error while adding client information.");
			io.printStackTrace();
			
		}
	}
	public String getClientIpAddr() {
		return clientIpAddr;
	}
	public void setClientIpAddr(String clientIpAddr) {
		this.clientIpAddr = clientIpAddr;
	}
	public int getConnectionId() {
		return connectionId;
	}
	public void setConnectionId(int connectionId) {
		this.connectionId = connectionId;
	}
	public BufferedReader getInput() {
		return input;
	}
	public PrintWriter getOutput() {
		return output;
	}
}
